#include "Equation.h"
#include <iostream>
#include "Dofs.h"
double f(double *p)
{
    return p[0] + p[1];
}

double bc(double *p)
{
    return (p[0] - p[1]);
}
struct bcf
{
    double operator()(double* p)
    {
        return p[0] + p[1];
    }

};

auto bcfunc = [](double* p)->double{return p[0] + p[1];};
int main()
{
    Equation<2>* equ = new PossionEquation<2>();
    equ ->SetBoundaryConditionFunction(bcfunc);
    equ ->SetRightHandsTermFunction(f);
    double x[] = {0,1};
    std::cout << equ->RightHandsTermFunction()(x) << std::endl;
    std::cout << equ ->RightHandsTermFunction()(x) << std::endl;
    Dofs<2> d({2,2});
    std::cout<< equ->RightHandsTermFunction()(*d) << std::endl;
}